
/*
	(c) Galustyan Sergey 2009
*/

#pragma once
#include "Lib.h"

namespace TestTask
{
	class SphereRender:public RenderObject{
		public:
					SphereRender( PDevice device, float radius, Vector3 position, Color color, XHandle render = "RenderScene" );
			float   getRadius();

		private:
			float radius;
	};

	declaresmart( SphereRender );

	void sphereToSphereAxis( PSphereRender s1, PSphereRender s2, Vector3& dir, Vector3& up, Vector3& right, Vector3& orig, Vector3& target );

	class ArrowManipulator:public RenderObject{
		public:
						 ArrowManipulator( PDevice device, Vector3 axis );
			virtual void Render(RenderPackage& rp);

		private:
			bool	drugging, hover;
			Vector3 axis, prev_direction, aabb_min, aabb_max;

			static  bool    onedrug;
			static  Matrix	iden;
	};

	class SuperSphere:public SphereRender{
		public:
						 SuperSphere( PDevice device, float radius, Vector3 position, Color color, PBorder border);
			virtual void Move( Vector3& offset );

		private:
			PBorder border;
	};

	declaresmart(SuperSphere)
	
	class LineRender:public RenderObject{
		public:
			LineRender( PDevice device, PRenderObject obj1, PRenderObject obj2 );
			virtual void Render( RenderPackage& rp );

		protected:
			PRenderObject o1,o2;
			PVertexBuffer vertexBuffer;
	};

}